package tk.heimashuma.store.service;

import org.springframework.data.elasticsearch.core.aggregation.AggregatedPage;
import tk.heimashuma.store.entity.Commodity;
import tk.heimashuma.store.entity.CommodityType;
import tk.heimashuma.store.entity.es.EsCommodity;
import tk.heimashuma.store.entity.vo.PagingVo;

import java.util.List;
import java.util.Optional;
import java.util.Set;

public interface CommodityService {
    PagingVo commodityAllList(PagingVo pagingVo);
    List<EsCommodity> commodityListByEs(String keyword);

    PagingVo countCommodityNum(PagingVo pagingVo);

    Optional<Commodity> findCommodity_infoById(Integer id);

    List<CommodityType> findCommodityTypeFirst();


    List<CommodityType> findCommodityTypeChildByName(String type);

    AggregatedPage<EsCommodity> commodityListSearchByEs(String keyword, Integer page, Integer size);

    List<CommodityType> getAllCommodityType();

    AggregatedPage<EsCommodity> commodityListSearchByEs(String keyword, Integer page, Integer size, Integer type);

    void saveHotWordToRedis(String keyword);

    Set<String> getHotWordByRedis();
}
